Optimal. Leaf size=55 \[ \frac{(a-b)^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac{1}{2} x (a+3 b) (a-b)+\frac{b^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0772035, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {3675, 390, 385, 203} \[ \frac{(a-b)^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac{1}{2} x (a+3 b) (a-b)+\frac{b^2 \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3675
Rule 390
Rule 385
Rule 203
Rubi steps
\begin{align*} \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{a^2-b^2+2 (a-b) b x^2}{\left (1+x^2\right )^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{b^2 \tan (c+d x)}{d}+\frac{\operatorname{Subst}\left (\int \frac{a^2-b^2+2 (a-b) b x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac{b^2 \tan (c+d x)}{d}+\frac{((a-b) (a+3 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac{1}{2} (a-b) (a+3 b) x+\frac{(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac{b^2 \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.394028, size = 55, normalized size = 1. \[ \frac{2 \left (a^2+2 a b-3 b^2\right ) (c+d x)+(a-b)^2 \sin (2 (c+d x))+4 b^2 \tan (c+d x)}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.043, size = 111, normalized size = 2. \begin{align*}{\frac{1}{d} \left ({b}^{2} \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{5}}{\cos \left ( dx+c \right ) }}+ \left ( \left ( \sin \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\sin \left ( dx+c \right ) }{2}} \right ) \cos \left ( dx+c \right ) -{\frac{3\,dx}{2}}-{\frac{3\,c}{2}} \right ) +2\,ab \left ( -1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +{a}^{2} \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.67371, size = 89, normalized size = 1.62 \begin{align*} \frac{2 \, b^{2} \tan \left (d x + c\right ) +{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )}{\left (d x + c\right )} + \frac{{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.41154, size = 166, normalized size = 3.02 \begin{align*} \frac{{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} d x \cos \left (d x + c\right ) +{\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.95463, size = 802, normalized size = 14.58 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]